<link rel="import" href="../../bower_components/polymer/polymer-element.html">

<dom-module id="observer-demo">
  <template>
    <style>
      :host{
        display: block;
      }
    </style>
    <div>[[name]]</div>
  </template>

  <script>
    /**
     * @ObserverDemo
     * @polymer
     */
    class ObserverDemo extends Polymer.Element {
      static get is() { return 'observer-demo'; }
      static get properties(){
        return {
          name:{
            type: String,
            value:"default value",
            observer:"_nameChanged"
          }
        }
      }
      _nameChanged(newValue, oldValue){
          console.log("新值：",newValue,"旧值：",oldValue)
      }
    }
    window.customElements.define(ObserverDemo.is, ObserverDemo);

  </script>
</dom-module>


